import React from 'react';
import { connect } from 'dva';
import { Route } from 'dva/router';
// import NewsList from './newsList';
// import NewsDetail from './newsDetail';
import asyncComponent from '../utils/asyncComponent.js';
const NewsList = asyncComponent(() => import('./newsList'));
const NewsDetail = asyncComponent(() => import('./newsDetail'));

function News({ match }) {

    console.log(`${match.url}/list`, `${match.url}/detail/:id`);
    return (
        <div>
            <span>我是新闻页面</span>
            <Route path={`${match.url}/list`} exact component={NewsList}></Route>
            <Route path={`${match.url}/detail/:id`} exact component={NewsDetail}></Route>
        </div>
    );
}

export default connect()(News);